from bace.bace import Base
from time import sleep
from selenium.webdriver.common.by import By

class SouSuoPage(Base):

    sousuokuang = (By.ID,'com.kongfz.app:id/ll_search')

    shurukuang = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[2]/android.widget.EditText')

    sousuoanniu = (By.XPATH,'//android.widget.TextView[@text="搜索"]')

    dy = (By.ID,'com.kongfz.app:id/tvHitLeft')
    def sousuoyewu(self,content):
        self.loc_ele(self.sousuokuang).click()
        sleep(3)
        self.loc_ele(self.shurukuang).send_keys(content)
        sleep(3)
        self.loc_ele(self.sousuoanniu).click()
        sleep(3)